package com.hptpd.questionnairesurvey.service;

import com.hptpd.questionnairesurvey.component.Result;
import com.hptpd.questionnairesurvey.service.base.IBaseService;
import com.hptpd.questionnairesurvey.vo.AddSurveyVo;
import com.hptpd.questionnairesurvey.vo.SurveyVo;
import com.hptpd.questionnairesurvey.vo.UserSurveyVo;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;

import java.util.Map;

/**
 * \* Created with IntelliJ IDEA.
 * \* Date: 2019/10/23
 * \*
 * \* Description:
 * \
 *
 * @author walter_long
 */
public interface ISurveyService extends IBaseService {
    /**
     * 分页列出调查
     * @param paramMap {Map<String, Object>}
     * @param pageable {Pageable}
     * @return {Result}
     */
    Result listSurveysByPage(Map<String, Object> paramMap, Pageable pageable);

    /**
     * 分页列出调查
     * @param paramMap {Map<String, Object>}
     * @param pageable {Pageable}
     * @return {Result}
     */
    Result listWxSurveysByPage(Map<String, Object> paramMap, Pageable pageable);

    /**
     * 删除调查
     * @param surveyVo {SurveyVo}
     * @return {Result}
     */
    Result restartSurvey(SurveyVo surveyVo);

    /**
     * 停止调查
     * @param surveyVo {SurveyVo}
     * @return {Result}
     */
    Result stopSurvey(SurveyVo surveyVo);

    /**
     * 新建调查
     * @param addSurveyVo AddSurveyVo
     * @return Result
     */
    Result addSurvey(AddSurveyVo addSurveyVo);

    /**
     * 根据用户ID统计调查
     * @param paramMap Map<String, Object>
     * @return Result
     */
    Result countByUserId(Map<String, Object> paramMap);

    /**
     * 用户完成调查
     * @param userSurveyVo UserSurveyVo
     * @return Result
     */
    Result userDoneSurvey(UserSurveyVo userSurveyVo);

    /**
     * 获得用户调查信息
     * @param userSurveyId String
     * @return Result
     */
    Result getUserSurvey(String userSurveyId);

    /**
     * 获得调查分数
     * @param userSurveyVo UserSurveyVo
     * @return Result
     */
    Result getCalculateSurveyResultGrades(UserSurveyVo userSurveyVo);

    /**
     * 调查导出
     * @param surveyId String
     * @return ResponseEntity<byte[]>
     */
    ResponseEntity<byte[]> exportExcel(String surveyId);
}
